﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LY.Entity.SearchEntity;
using LY.Entity.PageSearch;
using LY.Entity.Entities;
using LY.Entity;

namespace LY.Interface
{
    public interface IArticleService
    {

        //文章条数
        int GetArticleCount(int menuid);

        //文章资讯 前几条
        List<C_Article> GetArticleList(int menuid, int top);

        ///检索文章数据列表
        PagedList<C_Article> QueryArticleList(ArticleSearch search, PageView view);
        PagedList<C_Article> QueryListAll(ArticleSearch search, PageView view);

        //根据主键ID检索文章信息，返回单个实体对象
        C_Article GetArticle(int? id);
        C_Article GetArticleByMenu(int? sid);
        int GetArticleCountByMenu(int? sid);
        List<C_Article> GetArticleListByMenu(int? sid);

        //根据主键ID删除文章信息
        int DeleteArticle(int id);
        //新增、编辑文章信息
        int SaveArticle(C_Article wrticle);
        //新增、编辑栏目信息

        //检查Code是否已经存在
        int GetCode(string code);
        int GetCode(int id, string code);
        //根据栏目ID检查当前栏目下是否有文章信息
        int CheckArticle(int menuid);
        //根据栏目Id查询子栏目信息
        PagedList<C_Menu> QueryMenuListId(int? Id,ArticleSearch search,PageView view);



        //根据ID返回栏目信息
        C_Menu GetMenu(int? id);

        /// <summary>
        /// 检索投资信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<C_Menu> GetMenuSub(int? id);

        int SaveMenu(C_Menu menu);
        //删除栏目信息
        int DeleteMenu(int id);
        List<C_Menu> QueryMainMenuList(int id);


        List<C_Menu> GetUpperMenuList(int? id);
        //栏目列表
        PagedList<C_Menu> QueryMenuList(ArticleSearch search, PageView view);

        /// <summary>
        ///   /// 根据栏目CODE 检索新闻 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="top"></param>
        /// <returns></returns>
        List<C_Article> GetArticleList(string code, int top);
    }
}
